home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr05 / xnot12a.zip / MGPROG.DOC < prev    next >
Text File  |  1993-04-07  |  16KB  |  389 lines

  1. +This doc is updated to cover notGNU emacs converted from MicroGnuEmacs (mg) 2a.
  2.  
  3. -This documentation covers mg 2a.
  4. -
  5. -I do want feedback from other mg developers on what they think of my
  6. -changes, documentation, and what needs to be done to make mg better.
  7. -This document is not complete, it mainly covers the areas I have
  8. -recently changed.
  9. -
  10. -Possible future changes:
  11. -
  12. -Rearange file contents along more rational lines.  Further split the
  13. -monolithic def.h file.
  14. -
  15. -Changing the echo line stuff to use a minibuffer keymap.
  16. -
  17. -Making the kill buffer a linked list of lines.
  18. -
  19. -Variables.
  20. -
  21. -Allow for backspace, ^s, etc. to be changed in some reasonable manner. 
  22. -(Probably using variables or a simulation thereof.)  I do not think an
  23. -input keymap is the correct solution, even if it is frequently used in
  24. -Gnu emacs.  (Besides the extra overhead, keynames come out wrong.)
  25. -
  26. -Make long lines wrap like they do in GNU emacs.
  27. -
  28. -Fix known (and unknown :-) bugs.
  29. -
  30. -Have the keymaps and associated tables generated by a program.
  31. -
  32. -Known bugs/limitations:
  33. -
  34. -Binding a key in a named keymap may or may not change the binding of
  35. -other keys pointing to the same keymap.     (i.e. if ^H and ^_ are bound
  36. -to help, rebinding ^Hb may not (or may) change ^_b.  This can be cured
  37. -by rebinding ^_ to help.)
  38. -
  39. -Overwrite mode does not work in macros.     (Characters are inserted
  40. -rather than overwriting.)
  41. -
  42. -Dired mode has some problems:  Rename does not update the buffer.
  43. -Doing a dired again will update the buffer (whether it needs it or
  44. -not) and will lose any marks for deletion.  .. and . are not
  45. -recognized as special cases.
  46. +
  47. + Dired mode has been changed, Supported now is only edit (e), find file (f)
  48. + view file (v - read only) and mouse dbl click to do implicit find file.
  49. +
  50. -
  51. -
  52. -New implementation oddities:
  53. -
  54. -insert and define-key are new commands corresponding to the mocklisp
  55. -functions in Gnu Emacs.     (Mg does not have non-command functions.)
  56. -(Mg's insert will only insert one string.)
  57. -
  58. -The display wrap code does not work at all like that of GNU emacs.
  59. -
  60. -
  61. -Adding command functions to mg:
  62. -
  63. -Command functions take two integer aguments and return an integer.
  64. -The first argument, f, is a set of flags.  (f&FFARG) is non-zero if a
  65. -numeric arguement was passed to the function.  (There are bits
  66. -indicating how the agument was specified, but they are not fully
  67. -impleminted.)  (f&FFRAND) is non-zero if the function is being called
  68. -by another function and that possibly slightly different action should
  69. -be taken.  (No error checking, supress output, etc.)  The second
  70. -argument, n, is the numeric agument passed or one if there was no
  71. -numeric arugment.  The fuction should return TRUE if it executes
  72. -correctly, FALSE if it could not, and ABORT if the user typed the
  73. -keyboard quit character at a prompt.
  74. -
  75. -The function must be added to the functnames table in keymap.c.This
  76. -table must be kept in ascending ascii sequence.
  77. -
  78. -
  79. -Key maps:
  80. -
  81. -Key maps are structures containing information on what action should
  82. -be taken corresponding to an individual keypress.  That action could
  83. -be an indication that this is a prefix key and the next kepress should
  84. -be looked up in another keymap.
  85. -
  86. -    Example keymap:
  87. -
  88. -    static    struct    KEYMAPE(6+IMAPEXT)    cXmap = {
  89. -        6,
  90. -        6+IMAPEXT,
  91. -        rescan,
  92. -        {
  93. -            {CCHR('B'),CCHR('G'),    cXcB,    (KEYMAP *)NULL},
  94. -            {CCHR('L'),CCHR('X'),    cXcL,    (KEYMAP *)NULL},
  95. -            {'(',    ')',        cXlp,    (KEYMAP *)NULL},
  96. -            {'0',    '4',        cX0,    (KEYMAP *)&cX4map},
  97. -            {'=',    '=',        cXeq,    (KEYMAP *)NULL},
  98. -            {'^',    's',        cXcar,    (KEYMAP *)NULL},
  99. -        }
  100. -    };
  101. -
  102. -(Note: this example is a simplified example of a real keymap in keymap.c.)
  103. -
  104. -Since C does not directly support structures containing undimentioned
  105. -arrays, the macro KEYMAPE is used to create a structure with an array
  106. -of the proper size.  6 is the current size of the array, and IMAPEXT
  107. -is the number of extra elements left for future groth (by rebinding
  108. -keys) before the map must be reallocated.  rescan is the function to
  109. -be executed if a specific entry for the key is not found.  (rescan is
  110. -a special function that searches for something else to do -- first by
  111. -trying lowercasing the last character in the keymap, then by trying
  112. -the other modes in effect.)
  113. -
  114. -The array elements must be in order by the keys they define.  Each
  115. -covers a range of characters.  Numeric values should not be used for
  116. -characters, they make porting mg to some other systems harder.    The
  117. -CCHR macro may be used to specify control characters, including DEL
  118. -(CCHR('?')).  cXcB, cXcL, etc. are arrays of pointers to functions
  119. -returning int.    One of these fuction pointers per element may be to
  120. -the pseuto-function prefix.  cX4map is the keymap coresponding to the
  121. -prefix function bound to '4' in this keymap.  Having several keys in
  122. -an element bound to the default function is better than increasing the
  123. -number of elements.
  124. -
  125. -
  126. -Modes:
  127. -
  128. -Modes are named key maps that are scanned for key bindings before the
  129. -global keymap is.  There are functions in modes.c to toggle modes on
  130. -or off for individual buffers.  Note that the "major"/"minor" mode
  131. -distiction is different than in Gnu Emacs.  Dired is currently the
  132. -only major mode available, buffers are put into dired mode on creation
  133. -by the dired code.  (The distiction in mg is the major mode replaces
  134. -the default keymap instead of being an overlay.) Some modes (overwrite
  135. -and no-tab) also trigger per-buffer flags that should be convered to
  136. -per-buffer variables when we add variables.  Keymaps for the modes are
  137. -kept in keymap.c with the other keymaps.
  138. -
  139. + New mode is C-mode. Currently set on file read if .c,.cpp or .h extension.
  140. + This is equivalent to blink-matching-paren mode which is now 'hidden'.
  141. + At some time, there will be smarter indent code for C formatting (under way).
  142. +
  143. -
  144. -System dependent files:
  145. -
  146. +
  147. + dos.c
  148. + Dos specific things for file io and directory scanning. No longer uses
  149. + dir > outfile.  Also unix.c which has similiar os dependencies.
  150. +
  151. -Fileio.c:
  152. -    Contains file i/o routines:
  153. -        ffputbuf(BUFFER *):
  154. -Write all lines of buffer to the file.    The last line of the buffer does
  155. -NOT have the normally implied newline.    (One may be added if
  156. -nessisary, but don't write out the last line if it is zero characters
  157. -long.)
  158. -
  159. -        ffgetline(char *buf, int nbuf, int *nbytes):
  160. -Read a line from the file up to the length specified by the second
  161. -argument in to the buffer pointed to by the first.  If a newline is
  162. -not found after reading nbuf characters, return FIOLONG and on the
  163. -next call to ffgetline return the remaining portion (or nbuf more
  164. -characters and return FIOLONG).     If a newline is found, set *nbytes to
  165. -the number of characters read and return FIOSUC.  If the end of file
  166. -is descovered, set *nbytes and return FIOEOF.  (If the file ends in a
  167. -newline, the call returning FIOEOF will set *nbytes to 0.)  If any
  168. -other error occurs, return FIOERR.
  169. -
  170. -        char *adjustname(char *fname)
  171. +
  172. +(renamed to adjustnamecase, adjustname is now adjustmsdosfunction)
  173. +
  174. -Standardize filename.  On mono-case systems, lowercase the file name.
  175. -If NO_DIR is not defined, make fully qualified.     (not relitive to the
  176. -current directory, which may change.)
  177. -
  178. -        fncmp(char *fna, char *fnb) 
  179. -Return 0 if both arguments refer to the same file or buffer.  #define
  180. -it to be strcmp on mono-case or case sensitive systems, use a non-case
  181. -sensitive compareison otherwise.  (Borrow it from the osk fileio.c)
  182. -Both arguments have been through adjustname already. 
  183. -
  184. -    routines needed for dired:
  185. -
  186. -        rename(char *fromname, char *toname)
  187. -rename file.  BSD systems have this as a system call.  return -1 on
  188. -error.
  189. -
  190. +
  191. + no longer needed
  192. +
  193. -        copy(char *fromname, char *toname)
  194. -copy file.  return -1 on error.
  195. -
  196. +
  197. + rewritten to use C runtime as is more portable
  198. +
  199. -        unlinkdir(char *name)
  200. -Delete directory.  return -1 on error.  (possibly including non-empty
  201. -directory.)
  202. -
  203. + unlinkdir no longer needed, or used
  204. +
  205. -        BUFFER *dired_(char *name)
  206. -Create dired buffer for named directory.  See example from osk or bsd.
  207. +
  208. + rewritten in my own strange OS dependent way
  209. +
  210. -
  211. -        d_makename(LINE *l, char *fname)
  212. -Concatinate directory name associated with the current dired BUFFER
  213. -with file name in line.  Return ABORT if no file name on line, FALSE
  214. -if it is an ordinary file, or TRUE if there is a directory.  Name made
  215. -should be the same as if it were run through adjustname. 
  216. +
  217. + also rewritten somewhat to handle wild cards in dir buffname
  218. +
  219. -
  220. -
  221. -Converting system & terminal dependent files from mg1b:
  222. -
  223. -All command functions will have to be rewritten to use the new two
  224. -argument calling sequence.  (Some compilers will let you get away
  225. -without doing this for testing purposes.  Problems, if any, will show
  226. -up at run-time.)
  227. -
  228. -Key binding is completly different.  See extend.c if your code needs
  229. -to do rebinding.
  230. -
  231. -I have attempted make mg less dependant on ascii character values.
  232. -Keymap.c depends on ascii sorting order.  Cinfo.c depends on character
  233. -values and contains a function to convert from a character value
  234. -to a key name.  Several modules assume 3 octal digits are enough for
  235. -any character value.
  236. -
  237. -Names of most compile time options have changed.  Whatever is most
  238. -GNU-emacs like is now the default.
  239. -
  240. -sysdef.h:
  241. -    The type KEY should not be defined.  The type KCHAR should be defined.
  242. -    All posible key inputs must be positive in type KCHAR.    short is
  243. -    recomended.
  244. -
  245. -spawn.c:
  246. -    Update to the new function calling conventions.
  247. -
  248. + modified to use w3win.c (for Windows or unix.c for X11) supplied functions
  249. + for 'spawing' a shell window (Windows 3.1) or run a shell command
  250. +
  251. -Makefile:
  252. -    Needs complete rewrite.     You can probably figure out the dependencies
  253. -    from the bsd or osk one.  Compile time options have changed.
  254. +
  255. + rewritten to have makefile.msc for C7 DOS build and makefile for C7 
  256. + Windows 3.1 build (building dosngnu.exe and notgnu.exe)
  257. -
  258. -Fileio.c:
  259. -    Remove function ffputline.  Add function ffputbuf (described above).
  260. -    Rewrite ffgetline to conform to the new way of doing things.  (see
  261. -    above.)  These routines can probably be borrowed intact from the
  262. -    OSK system dependant fileio.c for unix systems.
  263. -    Replace adjustcase with adjustname.  Add fncmp either here or
  264. -    as a #define in sysdef.h.  Add functions needed by dired.
  265. -
  266. -
  267. -Compile time options:
  268. -
  269. -extentions not directly in gnu emacs
  270. -
  271. -BSMAP        input mapping exchanging ^H and DEL.
  272. -        1 for defaulting to this, 0 for normal default.
  273. -NOTAB        for systems that don't like tabs
  274. -CVMVAS        arguments to ^V in screens not lines
  275. -PREFIXREGION    prefix region
  276. -PREVWIND    previous window
  277. -GOSREC        Gossling style recenter
  278. -STARTUPFILE    (unix & OSK) system-wide startup file
  279. -XKEYS        (Termcap) Put kepad in alternate mode, use
  280. -        terminal-dependent startup file.
  281. +
  282. + beware - most ifdef'ed (ifndef) functions are in the process of being
  283. + made non-optional; ie you will get them all (excepting REGEX).
  284. -
  285. -Features removeable to save space
  286. -
  287. -NO_HELP    help, descibe-bindings, describe-key-briefly, apropos
  288. -NO_MACRO    keyboard macros.  If defined, NO_STARTUP must be also.
  289. -NO_STARTUP    startup files, load, etc.
  290. -NO_BACKUP    backup files when writing
  291. -NO_DPROMPT    Delayed prompt on multi-key sequences
  292. -NO_DIR        Dir change functions.  If defined, NO_DIRED must be also.
  293. -NO_DIRED    Dired mode
  294. -REGEX        Regular expressions.  Not default, since the code is rather
  295. -        unportable and has the GNU copywrite on it.
  296. -
  297. -System dependant garbage (avoid where practical)
  298. -
  299. -VMS        VMS
  300. -AMIGA        AMIGA
  301. -
  302. -
  303. -Things that may be defined in system dependant code:
  304. -
  305. -XCHAR        XCHAR and XSHORT    (char and short for space savings)
  306. -BDC2        more special characters for filenames
  307. -BDC3        dito.
  308. -METABIT    Bit of KCHAR set on meta keys
  309. -OFFSET        macro to calculate offset of member from start of structure
  310. +
  311. + no longer used, not portable to all ULTRIX compilers
  312. +
  313. -NBLOCK        line growth amount
  314. -KBLOCK        kill buffer growth amount
  315. -MALLOCROUND    macro to predict malloc allocations stratagy
  316. -SYSINIT    system dependant initialization
  317. -NO_VOID_TYPE    compiler dosen't have type void
  318. -ZEROARRAY    zero length arrays are allowed
  319. -BINDKEY    include bindkey routine for use by system & terminal
  320. -        dependent code.
  321. -
  322. -Terminal dependant
  323. -
  324. -DO_METAKEY    meta key
  325. -METABIT    Which bit in a KCHAR is used by the meta key (default 0x80)
  326. -STANDOUT_GLITCH standout (may) take character position(s)
  327. -GOSLING    optimize redisplay
  328. -MEMMAP        memory mapped display
  329. +
  330. + no longer available, replaced by WINDOWED for functions and fast output
  331. +
  332. -MOVE_STANDOUT    cursor addressing may be done in standout mode
  333. -FKEYS        function keys do not fit in type char.
  334. -        Not for use where function keys send multiple characters.
  335. +
  336. +
  337. + Note that existing code base will probably not build correctly w/o
  338. + #define JAM. Some bugs were fixed, and more gnu-like things added within
  339. + those ifdefs. I will eventually clean the source files up. In addition,
  340. + most functions listed above (things to remove to save space) no longer
  341. + can be simply turned off. This set of sources is biased (heavily!) to
  342. + working within a windowing systems impling that (1) memory may not be cheap 
  343. + but it's pageable (2) most any key on the keyboard can be seen as a single
  344. + event, or mapped to one by window specific support code and (3) mouse support,
  345. + etc is worth it.
  346. +
  347. + New things:
  348. +    
  349. +    cwd        -    the current directory is now ALWAYS based on
  350. +                directory of the current buffer or startup dir.
  351. +                no 'cd' command anymore.
  352. +    directory preload    -    for any function which wants to collect a file
  353. +                name, the cwd is preloaded in the input stream
  354. +    incremental saves    -    a timer is set and every (not settable) 
  355. +                interval, all changed buffers are written to
  356. +                incremental files (except if no file name!)
  357. +                               (not in DOS version)
  358. +    mouse support    -    improved mouse support from original basic
  359. +                amiga support. Now window system independent,
  360. +                and supports drag-select of region. (WINDOWED
  361. +                               builds only ie X11 and Windows 3.1). also
  362. +                allows resize of subwindows (panes) via drag
  363. +                on mode line.
  364. +    read only buffer    -    read only mode. can be activated via view-file
  365. +                or by toggle-readonly-state. help buffer and
  366. +                buffer list are now read-only. same for dired
  367. +                buffers.
  368. +    modified state    -    changed toggle-modified-state; modified from
  369. +                               original set-change state or whatever
  370. +    dired mode        -    removed some dangerous (broken) file operations
  371. +                in favor of 'e', 'f' and 'v' commands. mouse
  372. +                double click of course works.
  373. +
  374. +    electric buff list    -    gnu-like buffer list buffer. 'u' on a name
  375. +                will do a use-buffer, 'k' on the name will 
  376. +                do a kill-buffer. mouse double click does 'u'.    
  377. +    toggle-window-menu    -    for Windows 3.+; small subset of commands
  378. +                accessable via a menu bar. However, ALT-* won't
  379. +                               navigate you there. The purpose is for new
  380. +
  381. +                NOTE that Windows 3.+ system menu has new
  382. +                functions added for changing FONT, saving
  383. +                current window size/font as well as getting the
  384. +                menu bar.
  385.  
  386. +                users and access to PRINT, and clipboard stuff.
  387. +    revert-to-incremental    allows current buffer to be reloaded from 
  388. +                incremental save file; a warning is printed
  389. +                from find-file* if incremental backup is found.